//
//  UCDownloadOfflineMap.m
//  SDK开发版本
//
//  Created by 北京国泰北斗科技有限公司 on 2016/12/12.
//  Copyright © 2016年 北京国泰北斗科技有限公司. All rights reserved.
//

#define IS_IOS10ORLATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10)

#import "UCDownloadOfflineMap.h"
#import "UCMapView.h"
#import <GoogleMaps/GoogleMaps.h>
#import "UCDownloadArea.h"

NSString * const kAeroMapNormal = @"GoogleChinaMap";
NSString * const kAeroMapTerrain = @"GoogleChinaTerrainMap";
NSString * const kAeroMapSatellite = @"GoogleChinaHybridMap";

@interface UCDownloadOfflineMap()

@property(nonatomic,strong)UCDownloadArea *download;

@end

@implementation UCDownloadOfflineMap

- (void)getMapTitleCounWithSumMemory:(NSArray *)levels withPath:(UCPath *)path with:(void(^)(long long sumCount,double sumMemory))block{
    
    UCDownloadArea *download = [[UCDownloadArea alloc] initGetDownloadAreaWith:path withLevelsSet:levels];
    block ? block(download.sumCount,download.sumMemory) : nil;
}

- (UCDownloadArea *)downloadAreaWithMapType:(NSString *)mapType withPath:(UCPath *)path withLevels:(NSArray *)levelsSet withAreaName:(NSString *)areaName{
    
    self.download = [[UCDownloadArea alloc] initGetDownloadAreaWith:path withLevelsSet:levelsSet];
    self.download.cacheName = areaName;
    self.download.mapType = mapType;
    //    NSLog(@"一共需要下载%ld张瓦片,已经下载了%ld张瓦片,大约:%.2fM",(unsigned long)_download.sumCount,(unsigned long)_download.downloadCount,_download.sumMemory);
    
    return self.download;
}
@end
